package com.lanmao.mall.controller;

import com.lanmao.mall.service.CategoryService;
import com.lanmao.mall.util.ResultResponse;
import com.lanmao.mall.vo.CategoryVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 商品三级分类 前端控制器
 * </p>
 *
 * @author lanmao
 * @since 2023-11-24
 */
@RestController
@Tag(name = "商品")
@RequestMapping("/category")
@RequiredArgsConstructor
public class CategoryController {

    private final CategoryService categoryService;

    @GetMapping("/test")
    @Operation(summary = "测试接口")
    public ResultResponse<List<CategoryVO>> list() {
        List<CategoryVO> list = categoryService.getCategoryList();
        return ResultResponse.success(list);
    }

}
